function amtcalc(age, time, year, place, bday, fww, king, recog, count, address){

var amtscore=0;
var severity ="normal cognitive function.";

if (age){age=1;}else{age=0;}
if (time){time=1;}else{time=0;}
if (year){year=1;}else{year=0;}
if (place){place=1;}else{place=0;}
if (bday){bday=1;}else{bday=0;}
if (fww){fww=1;}else{fww=0;}
if (king){king=1;}else{king=0;}
if (recog){recog=1;}else{recog=0;}
if (count){count=1;}else{count=0;}
if (address){address=1;}else{address=0;}

amtscore= age + time + year + place + bday + fww + king + recog + count + address;


if (amtscore<8) {
severity="abnormal cognitive function";
}


return {
			 amtscore:amtscore,
			 severity:severity
	};		 
}



function ref(){
// display reference

var ref1="Jitapunkul S, Pillay I, Ebrahim S. The abbreviated mental test: its use and validity <a href='http://ageing.oxfordjournals.org/cgi/content/abstract/20/5/332'>Age Ageing. 1991 Sep;20(5):332-6</a>. ";
var ref2="<br /> See also the <a href='http://www.patient.co.uk/doctor/Abbreviated-Mental-Test-%28AMT%29.htm'>Patient UK site</a> for more info";
return ref1 + ref2;
}